<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <form id="myForm">
        <input type="text" name="name">
        <input type="password" name="password">
        <input type="submit" value="提交表单">
    </form>
    <script src="./jquery-1.12.4.js"></script>
    <script>
    $(function(){
       $('#myForm').on('submit',function(e){
           e.preventDefault();
        //    console.log(111);
        console.log($('#myForm').serialize());
       }) 
    });
    </script>
</body>
</html>